var ides = document.getElementById("idSlideView1")
var flag = false
var idespin = document.getElementById("idSlideView2")
var flagpin = false
var idestalk = document.getElementById("idSlideView3")
var flagtalk = false
ides.onclick = function() {
    var idshide = ides.parentNode.children[1];
    flag = !flag
    if (flag) {
        idshide.style.display = 'none'
        ides.children[1].src = "../images/phoneGlobal/down.png"
    } else {
        idshide.style.display = 'block'
        ides.children[1].src = "../images/phoneGlobal/up.png"
    }
}
idespin.onclick = function() {
    var idshidepin = idespin.parentNode.children[1];
    flagpin = !flagpin
    if (flagpin) {
        idshidepin.style.display = 'none'
        idespin.children[1].src = "../images/phoneGlobal/down.png"
    } else {
        idshidepin.style.display = 'block'
        idespin.children[1].src = "../images/phoneGlobal/up.png"
    }
}
idestalk.onclick = function() {
    var idshidetalk = idestalk.parentNode.children[1];
    flagtalk = !flagtalk
    if (flagtalk) {
        idshidetalk.style.display = 'none'
        idestalk.children[1].src = "../images/phoneGlobal/down.png"
    } else {
        idshidetalk.style.display = 'block'
        idestalk.children[1].src = "../images/phoneGlobal/up.png"
    }
}
window.onload = function() {
    var obtn = document.getElementById('btn'); //获取回到顶部按钮的ID
    var clientHeight = document.documentElement.clientHeight; //获取可视区域的高度
    var timer = null; //定义一个定时器
    var isTop = true; //定义一个布尔值，用于判断是否到达顶部

    window.onscroll = function() { //滚动条滚动事件

        //获取滚动条的滚动高度
        var osTop = document.documentElement.scrollTop || document.body.scrollTop;

        if (osTop >= clientHeight) { //如果滚动高度大于可视区域高度，则显示回到顶部按钮
            obtn.style.display = 'block';
        } else { //否则隐藏
            // obtn.style.display = 'none';
        }

        //主要用于判断当 点击回到顶部按钮后 滚动条在回滚过程中，若手动滚动滚动条，则清除定时器
        if (!isTop) {

            clearInterval(timer);
        }
        isTop = false;

    }

    obtn.onclick = function() { //回到顶部按钮点击事件
        //设置一个定时器
        timer = setInterval(function() {
            //获取滚动条的滚动高度
            var osTop = document.documentElement.scrollTop || document.body.scrollTop;
            //用于设置速度差，产生缓动的效果
            var speed = Math.floor(-osTop / 6);
            document.documentElement.scrollTop = document.body.scrollTop = osTop + speed;
            isTop = true; //用于阻止滚动事件清除定时器
            if (osTop == 0) {
                clearInterval(timer);
            }
        }, 30);
    }
}
var bodys = document.getElementById("footer")
var myImgs = document.getElementById("myImg")
var myImgTel = document.getElementById("myImgTel")
var wxs = document.getElementById("wx")
var apps = document.getElementById("apps")
var zhaopin = document.getElementById("zhaopin")
var kehu = document.getElementById("kehu")
var coms = document.getElementById("coms")
wxs.onclick = function(e) {
    e.stopPropagation();
    e.preventDefault();
    myImgs.style.display = 'block'
    myImgs.src = "../images/global/wx.png"
    myImgTel.style.display = 'none'
}
apps.onclick = function(e) {
    e.stopPropagation();
    e.preventDefault();
    myImgs.style.display = 'block'
    myImgs.src = "../images/global/app.png"
    myImgTel.style.display = 'none'
}
zhaopin.onclick = function(e) {
    e.stopPropagation();
    e.preventDefault();
    myImgs.style.display = 'block'
    myImgs.src = "../images/global/recruit.png"
    myImgTel.style.display = 'none'
}
kehu.onclick = function(e) {
    e.stopPropagation();
    e.preventDefault();
    myImgTel.style.display = 'block'
    myImgTel.src = "../images/global/g2.png"
    myImgs.style.display = 'none'
}
coms.onclick = function(e) {
    e.stopPropagation();
    e.preventDefault();
    myImgTel.style.display = 'block'
    myImgTel.src = "../images/global/g1.png"
    myImgs.style.display = 'none'
}
bodys.onclick = function() {
    myImgs.style.display = 'none'
    myImgTel.style.display = 'none'
}
myImgs.onclick = function(e) {
    e.stopPropagation();
    e.preventDefault();
    myImgs.style.display = 'block'
}
myImgTel.onclick = function(e) {
    e.stopPropagation();
    e.preventDefault();
    myImgTel.style.display = 'block'
}
